package com.jinhua.usercenter.common;

import lombok.Data;

@Data
public class Result<T> {
    private T data;
    private int code;
    private String message;

    public Result(int code,T data,String message){
        this.code = code;
        this.data = data;
        this.message = message;
    }

    public Result(int code, T data){
        this(code,data,"");
    }

    public int getCode() {
        return code;
    }

    public Result(ErrorCode errorCode){
        this(errorCode.getResultCode(),null, errorCode.getResultMsg());
    }



}
